package com.sitech.ibnms.c3p.service;

import org.apache.ignite.Ignite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.locks.Lock;

/**
 * Created by leo on 2017/1/16.
 */
@Service
public class DistributeLock {
    @Autowired
    private Ignite ignite;

    public Lock newLock(Object key) {
        return ignite.cache("locks").lock(key);
    }
}
